/**
 * @author Steve Gao<gaofu@parllay.com>
 */
const BaseHandler     = require('../base-handler');
const HTTP_VERBS      = require('../../../constants').HTTP_VERBS;

class WallReportsHandler extends BaseHandler {

    get pattern() {
        return '/walls/:wall_id/settings';
    }

    doGET(request, response) {
        response.json({
            success: false,
            error: 'Not Support'
        });
    }

    doPOST(request, response) {
        var settings = request.body;
        var wallId   = request.params.wall_id;
        this.Controller.saveOrUpdateWallSettings(wallId, settings, (result) => {
            response.json(result);
        });
    }

    setup() {
        this.registerVerb(HTTP_VERBS.POST, this.doPOST);
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
    }
}

module.exports = WallReportsHandler;